﻿using System;
using System.Data;

namespace Unis.Framework.ORM.Attributes
{
    [AttributeUsage(AttributeTargets.Property)]
    public class ColumnMapAttribute : Attribute
    {
        // Fields
        private string _Description;
        private string columnName;
        private DbType dbtype;
        private object defaultValue;

        // Methods
        public ColumnMapAttribute(string columnName, DbType dbtype)
        {
            this.columnName = columnName;
            this.dbtype = dbtype;
        }

        public ColumnMapAttribute(string columnName, DbType dbtype, object defaultValue)
        {
            this.columnName = columnName;
            this.dbtype = dbtype;
            this.defaultValue = defaultValue;
        }

        public ColumnMapAttribute(string columnName, string description, DbType dbtype)
        {
            this.columnName = columnName;
            this.dbtype = dbtype;
            this._Description = description;
        }

        // Properties
        public string ColumnName
        {
            get
            {
                return this.columnName;
            }
            set
            {
                this.columnName = value;
            }
        }

        public DbType DbType
        {
            get
            {
                return this.dbtype;
            }
            set
            {
                this.dbtype = value;
            }
        }

        public object DefaultValue
        {
            get
            {
                return this.defaultValue;
            }
            set
            {
                this.defaultValue = value;
            }
        }

        public string Description
        {
            get
            {
                return this._Description;
            }
            set
            {
                this._Description = value;
            }
        }
    }
}
